public class Daji_test2 {
    public static void main(String arg[]){
        A as = new A_1();
        as.print();

    }
}

/*
创建三个类:
    A是父类
    A_1、A_2均是子类
 */
class A{
    public void print(){
        String s = "";
        System.out.println(s);
    }
}
class A_1 extends A{
    public void print(){
        String s1 = "你好";
        System.out.println(s1);
    }
}
class A_2 extends A{
    public void print(){
        System.out.println("000");
    }
}